﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Fjaspx.UI.Web;

namespace Fjaspx.UCenter
{
    public partial class Flash : UserPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) { 
                Bind();
                if (Request["del"] != null) { ___ROYcms_Flash_bll.Delete(Convert.ToInt32(Request["del"])); Bind(); }
            }
        }
        void Bind()
        {
            Repeater_list.DataSource = ___ROYcms_Flash_bll.GetList("id>0 order by id desc ");
            Repeater_list.DataBind();
        }

        protected void Button_ADDflash_Click(object sender, EventArgs e)
        {
            int User_Id = int.Parse(Fjaspx.Common.Session.Get("user_id"));
            string title = this.TextBox_flash_title.Text;
            DateTime Time = DateTime.Now;
            ___ROYcms_Flash_model.User_Id = User_Id;
            ___ROYcms_Flash_model.title = title;
            ___ROYcms_Flash_model.Time = Time;
            ___ROYcms_Flash_bll.Add(___ROYcms_Flash_model);
            //从新绑定一下
            Bind();
        }
    }
}
